/**
 * Created by zhouli on 18/2/7
 * Email li.zhou@huilianyi.com
 */
import config from 'config';
import httpFetch from 'share/httpFetch';
import errorMessage from 'share/errorMessage';
import OrgService from 'containers/enterprise-manage/org-structure/org-structure.service';
export default {
  //搜索人：新查询员工的接口，可以加很多参数
  searchPersonInDep(params) {
    return new Promise((resolve, reject) => {
      OrgService.searchPersonInDep(params)
        .then((res) => {
          resolve(res)
        })
        .catch((err) => {
          errorMessage(err.response);
          reject(err);
        })
    })
  },

  //邀请没有激活的用户使用
  inviteUser(userOIDS){
    return new Promise((resolve, reject) => {
      httpFetch.post(config.baseUrl + '/api/refactor/users/invite', userOIDS)
        .then((res) => {
          resolve(res)
        })
        .catch((err) => {
          errorMessage(err.response);
          reject(err);
        })
    })
  },

}
